﻿@model SportStore.Models.Entities.Product
<script type="text/javascript">
    preloadImage(@(Model.ProductID),true,"itemimage_@( Model.ProductID)");
    preloadImage(@(Model.ProductID),false,"itemimage_@( Model.ProductID)");
</script>
<div class="item">
    @if (Model.ImageFileName != null)
    {
        <div style="float: left; margin-right: 20px" id="cont_@( Model.ProductID)">
            <img id="itemimage_@( Model.ProductID)" class="thumbs" alt="" style="height:75px; border: 1px solid silver; width:auto" src="/images/imgloading.gif" />
        </div>
    }
    <h3>@Model.Name</h3>
    @Model.Description
    <br><strong>@Model.Price</strong></br>
    @*using(Html.BeginForm("AddToCart","Cart")) {
@Html.HiddenFor(x=>x.ProductID)
@Html.Hidden("returnUrl",Request.Url.PathAndQuery)
<input type="submit" value="+ Add to cart" />
}*@
    <form class="actionbuttons">
    <input type="number" id="Quantity_@(Model.ProductID)" min="1" max="99" value="1" style="width:35px;"/>
    <input type="button" onclick="addToCart(@(Model.ProductID));" value="+ Add to cart" />
    </form>
    <h4>@Model.Price</h4>
</div>
